package com.bookstore.admin.notice.service;

import com.bookstore.admin.notice.dao.INoticeDao;
import com.bookstore.commons.beans.Notice;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class INoticeImpl implements INoticeService {

    @Resource
    INoticeDao noticeDao;

    @Override
    public List<Notice> findAllNotice() {
        return noticeDao.selectAllNotices();
    }



    @Override
    public int modifyNotice(Notice notice) {
        return noticeDao.updateNotice(notice);
    }

    @Override
    public Notice findNoticeById(Integer id) {
        return noticeDao.selectNoticeById(id);
    }

    @Override
    public int AddNotices(Notice notice) {
        return noticeDao.insertNotices(notice);
    }

    @Override
    public int removeNotice(int id) {
        return noticeDao.deleteNotice(id);
    }


}
